/**
 * @desc 获取节点信息Promise封装
 * @param view 节点对象
 * @param opt 参考uni-app nodesRef.fields  api  object参数说明： https://uniapp.dcloud.io/api/ui/nodes-info?id=nodesreffields
 */
const getNodeInfoSync = async (view, opt) => {
	// console.log(id)
	const resData = await new Promise((resolve, reject) => {
		try{
			view.fields(opt, data => {
				// console.log(data)
				resolve(data)
			}).exec()
		}catch(e){
			//TODO handle the exception
			console.log(e)
		}
	})
	return resData;
}

export default getNodeInfoSync